<template>
	<view class="item">
		<view class="left">
			<image :src="item.goods_big_logo || defualtImg" mode=""></image>
		</view>
		<view class="right">
			<view class="top">
				{{ item.goods_name }}
			</view>
			<view class="bottom">
				<!-- |是管道符号 -->
				￥{{ item.goods_price | toFixed }}
			</view>
		</view>
	</view>
	</view>
</template>

<script>
	export default {
		name: "my-goods",
		// item 商品的数据
		props: ['item'],
		data() {
			return {
				// 设置默认图片
				defualtImg: 'https://img3.doubanio.com/f/movie/8dd0c794499fe925ae2ae89ee30cd225750457b4/pics/movie/celebrity-default-medium.png'
			};
		},
		// 过滤器，用来处理页面上的数据
		filters: {
			// 使用过滤器时传入的数据
			toFixed (v) {
				// 将v保留两位小数
				return v.toFixed(2)
			}
		}
	}
</script>

<style lang="scss">
	.item {
		display: flex;
		padding: 20rpx 10rpx;
		border-bottom: 1px solid #ddd;

		.left {
			image {
				width: 200rpx;
				height: 200rpx;
				margin-right: 20rpx;
			}
		}

		.right {
			font-size: 12px;
			display: flex;
			flex-direction: column;
			justify-content: space-between;

			.top {
				overflow: hidden;
				text-overflow: ellipsis;
				display: -webkit-box;
				-webkit-box-orient: vertical;
				-webkit-line-clamp: 2;
			}

			.bottom {
				color: #c61d3a;
			}
		}

	}
</style>
